/**
 * Created by user on 2018/4/12.
 */
import { GlobalActions } from '../actions'
const global_state = {
  loading: true
}

const GlobalState = (state = global_state, action) => {
  switch (action.type) {
    case GlobalActions.GlobalType.toggleLoading:
      return Object.assign({}, state, {
        loading: action.loading
      })
    default:
      return state
  }
}

export default GlobalState
